package cn.broadsense.web.controller;

import cn.broadsense.biz.dto.ChannelOrgTreeDto;
import cn.broadsense.biz.service.ChannelOrgService;
import cn.broadsense.common.core.controller.BaseController;
import cn.broadsense.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author huangjinshi
 * @description
 * @createDate 2024-09-19 12:09:22
 */
@Api(tags = "设备标签")
@RequestMapping("/api/v1/channel/tag")
@RestController
public class ChannelTagController extends BaseController {

    private final ChannelOrgService channelOrgService;

    @Autowired
    public ChannelTagController(ChannelOrgService channelOrgService) {
        this.channelOrgService = channelOrgService;
    }

    @GetMapping("/option")
    @ApiOperation("获取下拉框")
    public R<List<ChannelOrgTreeDto>> getOption(String orgCode) {
        List<ChannelOrgTreeDto> list = channelOrgService.orgTree(orgCode);
        return R.ok(list);
    }
}
